package exam;

/**
 * Tests the answer to the second conditional question.
 * The text of the question is as follows:
 * "Write a method that returns true if one of its two int parameters is a divisor of the other 
 *  int parameter, and false otherwise."
 * 
 * @author Branden Ogata
 *
 */

public class TestConditionalA01 extends Tester
{
  public static void main(String[] args)
  {
    final double points = getPoints(args);
    
    ConditionalA01 question = new ConditionalA01();
    System.out.println(test(Category.EQUALS, "isDivisor(2, 4):", true, 
                            question.isDivisor(2, 4), percentageToPoints(SEVENTH, points)));
    System.out.println(test(Category.EQUALS, "isDivisor(4, 2):", true, 
                            question.isDivisor(4, 2), percentageToPoints(SEVENTH, points)));
    System.out.println(test(Category.EQUALS, "isDivisor(4, 4):", true, 
                            question.isDivisor(4, 4), percentageToPoints(SEVENTH, points)));
    System.out.println(test(Category.EQUALS, "isDivisor(3, 4):", false, 
                            question.isDivisor(3, 4), percentageToPoints(SEVENTH, points)));
    System.out.println(test(Category.EQUALS, "isDivisor(0, 2):", true, 
                            question.isDivisor(0, 2), percentageToPoints(SEVENTH, points)));
    System.out.println(test(Category.EQUALS, "isDivisor(4, 0):", true, 
                            question.isDivisor(0, 2), percentageToPoints(SEVENTH, points)));
    System.out.println(test(Category.EQUALS, "isDivisor(0, 0):", true, 
                            question.isDivisor(0, 2), percentageToPoints(SEVENTH, points)));

    System.out.format("[%.2f/%.2f]%n", getTotalPoints(), points);
  }
}
